package org.gruposp2p.aula.gwt.client.content;

import org.gruposp2p.aula.gwt.client.AulaApplication;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.i18n.client.Constants;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DecoratedTabPanel;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class ItemevaluablesDialogBox extends DialogBox {
	
	private AulaApplication aulaApplication;
	
	public static interface CwConstants extends Constants {
		String ItemevaluablesDialogBoxCaption();
		String ItemevaluablesDialogBoxItemLabel();
		String ItemevaluablesDialogBoxItemTypeLabel();
		String ItemevaluablesDialogBoxCompetencesLabel();
		String ItemevaluablesDialogBoxAccepButton();
	}
	  /**
	   * An instance of the constants.
	   */
	  private CwConstants constants;
	  //private FlexTable layout;
	
	public ItemevaluablesDialogBox (AulaApplication aulaApplication) {
		this.aulaApplication = aulaApplication;
		constants = aulaApplication.getConstants();
		showTabbedDialog();
	}
	
	private void showTabbedDialog () {
		VerticalPanel vPanel = new VerticalPanel ();
		setText(constants.ItemevaluablesDialogBoxCaption());  
	    // Create a tab panel
	    DecoratedTabPanel tabPanel = new DecoratedTabPanel();
	    tabPanel.setWidth("100%");
	    tabPanel.setHeight("300px");
	    //tabPanel.setAnimationEnabled(true);
	    tabPanel.add(getItemsPanel(), 
	    		constants.ItemevaluablesDialogBoxItemLabel());
	    tabPanel.add(getItemTypesPanel(), 
	    		constants.ItemevaluablesDialogBoxItemTypeLabel());	    
	    tabPanel.add(getCompetencesPanel(), 
	    		constants.ItemevaluablesDialogBoxCompetencesLabel());

	    // Return the content
	    tabPanel.selectTab(1);
	    vPanel.add(tabPanel);
	    
	    
	    Button acceptButton = new Button(constants.ItemevaluablesDialogBoxAccepButton(),
		        new ClickHandler() {
		          public void onClick(ClickEvent event) {
		            hide();
		          }
		        });		    
	    
	    vPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
	    vPanel.add(acceptButton);
	    setWidget(vPanel);
	}
	
	private Widget getItemsPanel () {
		VerticalPanel vPanel = new VerticalPanel();
		return vPanel;
	}
	
	private Widget getItemTypesPanel () {
		VerticalPanel vPanel = new VerticalPanel();
		return vPanel;
	}
	
	private Widget getCompetencesPanel () {
		VerticalPanel vPanel = new VerticalPanel();
		return vPanel;
	}
	


}
